/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"581AF934-DABA-4B5A-8FEE-55BE896C8DBC"}
 */
function aceptar(event) {
	importe_signo = importe * (-1)
	forms.liquidaciones_tbl.fecha_pago = fecha
	forms.liquidaciones_tbl.total_pago = importe
	if (databaseManager.saveData())
	{
		databaseManager.setAutoSave(true)
		var $win = application.getWindow('ALTA_PAGOS')
		$win.hide()
		$win.destroy()
		forms.liquidaciones_tbl.controller.recreateUI()
	}
	else
	{
		globals.DIALOGS.showErrorDialog('Error','Ocurrio un error','OK')
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"93A1214E-0F13-47C6-AE08-1B4CEB4476E0"}
 */
function cancelar(event) {
	databaseManager.revertEditedRecords()
	databaseManager.setAutoSave(true)
	var $win = application.getWindow('ALTA_PAGOS')
	$win.hide()
	$win.destroy()
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @private
 *
 * @properties={typeid:24,uuid:"936B3D5A-A19B-4DD5-9F3F-D97B005364C7"}
 */
function onShow(firstShow, event) {
	elements.fld_unidad.requestFocus()
}
